package com.controller;

import com.exception.Sysexception;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class TestController {
    @RequestMapping("/testException")
    public String testException() throws Exception{
        System.out.println("异常处理。。。");
        try {
            int a=10/0;
        } catch (Exception e) {
            throw new Sysexception("0不能作为除数！");
        }
        return "success";
    }
}
